# -*- coding:utf-8 -*-
#@Time  :      2020-12-30 13:09
#@Author:      xuzixiao
#@mail  :      xuzixiao@kuaishou.com
#@File  :      join_test.py
#@Description: \

## 可参照：https://www.cnblogs.com/anyux/articles/10466745.html
## 可参照：https://blog.csdn.net/weixin_37111106/article/details/85122988

import time
import multiprocessing

def doIt(num):
	print("Process num is : %s" % num)
	time.sleep(1)
	print('process  %s end' % num)
if __name__ == '__main__':
	print('mainProcess start')
	#记录一下开始执行的时间
	start_time = time.time()
	#创建三个子进程
	pool = multiprocessing.Pool(3)
	print('Child start')
	for i in range(3):
		# pool.apply_async(doIt,[i])
		pool.apply(doIt,(i,))
	print('mainProcess done time:%s s' % (time.time() - start_time))
